#include "Poller.h"
#include "Channel.h"

Poller::Poller(EventLoop *loop)
    : ownerLoop_(loop)
{
}

// 检查Poller是否已经管理了指定的Channel
bool Poller::hasChannel(Channel *channel) const
{
    auto it = channels_.find(channel->fd()); // 通过Channel的文件描述符来查找
    return it != channels_.end() && it->second == channel; // 确保找到的Channel与参数相符
}

/